import { ref } from 'vue'

export function useSparkAI() {
  const aiResponse = ref('')
  const loading = ref(false)

  async function sendToSparkAI(message: string) {
    loading.value = true
    // TODO: 调用讯飞星火API并处理流式响应
    // 示例：aiResponse.value = await fetchSparkAI(message)
    loading.value = false
  }

  return {
    aiResponse,
    loading,
    sendToSparkAI
  }
}